package com.example.controller;

import com.example.service.TestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 测试 sharding-jdbc
 */
@RestController
@RequestMapping("/test")
public class TestController {

   // TODO DEMO配置文件中，存在多种配置策略，如何只需要对某一种类型进行测试，则需要修改配置文件配置
   @Resource
   private TestService testService;

   @GetMapping("/table")
   public Object table() {
      return testService.table();

   }


   @GetMapping("/database/table")
   public Object databaseTable() {
      return testService.databaseTable();
   }

}